import aiohttp
from loguru import logger

async def send_callback(url: str, data: dict):
    async with aiohttp.ClientSession() as session:
        try:
            async with session.post(url, json=data, timeout=10) as resp:
                resp.raise_for_status()
                logger.info(f"Callback sent successfully for {data.get('doc_id')}")
        except Exception as e:
            logger.error(f"Failed to send callback: {str(e)}")
            # Optional: retry or log to dead-letter queue